package cn.sciento.starter.social.qq.connect;

import cn.sciento.starter.social.core.common.api.SocialApi;
import cn.sciento.starter.social.core.common.connect.SocialApiAdapter;
import cn.sciento.starter.social.qq.api.QQUser;
import org.springframework.social.connect.ConnectionValues;

public class QQApiAdapter extends SocialApiAdapter {
  public void setConnectionValues(SocialApi api, ConnectionValues values) {
    QQUser user = (QQUser)api.getUser();
    values.setDisplayName(user.getNickname());
    values.setImageUrl(user.getFigureurl());
    values.setProviderUserId(user.getOpenId());
    values.setProviderUnionId(user.getUnionId());
  }
}
